feat(approvals): declare decision actions on sys_approval_request (objectui#2678 P2-4)#3282
Merged
Merged
Conversation
…jectui#2678 P2-4)
Server-declared approve / reject / reassign actions on the request object, so
the console's generic action runtime renders and executes them wherever the
object is surfaced — the approvals inbox included. Each is a `type:'api'`
action targeting the existing REST route ({id} resolves from the row; actorId
defaults to the caller server-side), with typed params (comment; reassign's
`to`), a pending-only `visible` gate (display-only — the service's
pending-approver check stays authoritative), and a confirm on reject.
This is the framework half of the P2-4 SDUI migration: future decision
capabilities (enterprise act-as included) ship as metadata on this object,
not as hand-written inbox buttons. 137 tests green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016ypkQikZ55oWUHUnMebwXA
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 4 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
os-zhuang
marked this pull request as ready for review
July 19, 2026 13:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Framework half of objectui#2678 P2-4 (inbox action SDUI-ification). The UI counterpart (a generic
DeclaredActionsBarconsuming these) rides a parallel objectui PR.What
sys_approval_requestnow declares its decision actions as metadata —approval_approve,approval_reject,approval_reassign— each atype:'api'action targeting the existing approvals REST route:{id}in the target resolves from the row;actorIddefaults to the caller server-side (existing route behavior).comment(textarea) on all three; requiredtoon reassign.visible: 'record.status == "pending"'trims finished requests — display-only; the service's pending-approver check stays authoritative.confirmText; all threerefreshAfter.record_section(+list_itemfor approve/reject quick actions).Why
This is the structural fix for the "hand-edit the inbox per feature" anti-pattern (#2678 调研判定): with the actions declared on the object, the console's generic action runtime renders and executes them wherever the object is surfaced — so future decision capabilities (enterprise act-as, cloud#861 included) ship as metadata, with zero bespoke frontend.
Tests
Full
plugin-approvalssuite green (137) with the declaration in place (object schema parses eagerly at import, so an invalid action shape would fail every test).Refs
objectui#2678 (P2-4) · follows #3274 (merged)
🤖 Generated with Claude Code
Generated by Claude Code